package cn.itcast.bos.service.base.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import cn.itcast.bos.domain.base.Standard;
import cn.itcast.bos.service.base.IStandardService;

/** 
 * 标准的事物实现层
 *
 * @author Shao-Fei Fan 
 * @version 1.0,2017年9月1日 下午8:36:04 
 */
@Service
@Transactional
public class StandardServiceImpl implements IStandardService {
	
	@Autowired
	private cn.itcast.bos.Dao.base.IStandardDao standardDao;
	
	/**
	 * @see cn.itcast.bos.service.base.IStandardService#addStandard(Standard)
	 */
	@Override
	public void addStandard(Standard s) {
		standardDao.save(s);
	}
	
	/**
	 * @see cn.itcast.bos.service.base.IStandardService#showStandardByPage(Pageable)
	 */
	@Override
	public Page<Standard> showStandardByPage(Pageable pageable) {
		
		Page<Standard> page = standardDao.findAll(pageable);
		return page;
	}
	
	
	@Override
	public List<Standard> findAllStandard() {
		List<Standard> list = standardDao.findAll();
		return list;
	}

}
